package com.award.jdbc.connection;

import java.sql.Connection;
import java.sql.DriverManager;

public class JdbcConnection {
	private static final String URL = "jdbc:mysql://39.106.142.96:3306/awardSystem?useOldAliasMetadataBehavior=true";
	private static final String USER = "root";
	private static final String PASSWORD = "19970211";
	private static Connection ct = null;

	public Connection getConn() {
		try {
			// 链接数据库
			Class.forName("com.mysql.jdbc.Driver");
			// 得到链接
			ct = DriverManager.getConnection(URL, USER, PASSWORD);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return ct;
	}
}
